package com.ruibang.glass.produce.controller.lh;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruibang.glass.produce.constant.Constants;
import com.ruibang.glass.produce.domain.req.ElasticModulusReq;
import com.ruibang.glass.produce.entity.ElasticModulus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruibang.glass.produce.service.ElasticModulusService;

/**
 * <p>
 * 生产-理化-弹性模量 前端控制器
 * </p>
 *
 * @author songJinKang
 * @since 2024-03-13
 */
@RestController

@RequestMapping("/api/glass/produce/lh/elasticModulus")
@Api(value = "生产-理化-弹性模量控制器", tags = {"生产-理化-弹性模量接口"})
public class ElasticModulusController {

    @Autowired
    private ElasticModulusService elasticModulusService;

    @GetMapping("/getById/{id}")
    @ApiOperation(value = "获取生产-理化-弹性模量", notes = "获取生产-理化-弹性模量")
    public ResultBody getById(@PathVariable(value = "id") String id) {
        return ResultBody.success(elasticModulusService.getById(id));
    }

    @PostMapping("/save")
    @ApiOperation(value = "新增生产-理化-弹性模量", notes = "新增生产-理化-弹性模量")
    public ResultBody save(@RequestBody ElasticModulus elasticModulus) {
        elasticModulusService.saveInfo(elasticModulus);
        return ResultBody.success();
    }

    @DeleteMapping("/deleteById/{id}")
    @ApiOperation(value = "通过ID删除生产-理化-弹性模量", notes = "通过ID删除生产-理化-弹性模量")
    public ResultBody delete(@PathVariable(value = "id") String id) {
        elasticModulusService.delete(id);
        return ResultBody.success();
    }

    @PutMapping("/update")
    @ApiOperation(value = "修改生产-理化-弹性模量", notes = "修改生产-理化-弹性模量")
    public ResultBody edit(@RequestBody ElasticModulus elasticModulus) {
        elasticModulusService.edit(elasticModulus);
        return ResultBody.success();
    }

    @PostMapping("/pageQuery")
    @ApiOperation(value = "分页列表查询生产-理化-弹性模量", notes = "分页列表查询生产-理化-弹性模量")
    public ResultBody<IPage<ElasticModulus>> pageQuery(@RequestBody ElasticModulusReq elasticModulusReq) {
        return ResultBody.success(elasticModulusService.pageQuery(elasticModulusReq));
    }
}
